<template>
    <div class="rich-text-container">
      <a-tabs v-model:activeKey="activeKey">
        <a-tab-pane key="1" tab="TinyMCE">
          <TinyMCE :height="600" :upload="upload"></TinyMCE>
        </a-tab-pane>
        <a-tab-pane key="2" tab="WangEditor" force-render>
          <WangEditor></WangEditor>
        </a-tab-pane>
      </a-tabs>
    </div>
</template>

<script setup lang="ts">
import TinyMCE from '@/components/TinyMCE/index.vue'
import { ref } from 'vue';
import WangEditor from '@/components/WangEditor/index.vue'

const activeKey = ref('1')
function upload(file: File | Blob, fileName: string): Promise<string> {
  return new Promise((resolve) => {
    console.log(file, fileName);
    
    setTimeout(() => {
      resolve('https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png')
    }, 1000)
  })
}
</script>